import request from '@/utils/request.js'

// 获取用户频道列表接口

export const getUserChannelAPI = () => {
    return request.get('/v1_0/user/channels')
}
// 获取频道下文章列表数据api
export const getArtListApi = id => {
    return request.get('/v1_1/articles', {
        params: {
            channel_id: id, // 频道的id
            timestamp: Date.now(), // 时间戳
            with_top: 1// 固定值，为1
        }
    })
}

// 将文章设置为不敢兴趣

export const dislikeArticleApi = id => {
    return request.post('/v1_0/article/dislikes', {
    //   target 是文章id
          target: id
      })
}
// 举报文章接口
export const reportArticleApi = (id, type) => {
    return request.post('/v1_0/article/reports', {
        target: id,
        type
    })
}

// 获取全部文章列表数据
export const getAllChannelApi = () => {
   return request.get('/v1_0/channels')
}
// 提交用户频道api
// channelArr格式【{ id，seq}】
export const updateUserChannelApi = (channelArr) => {
    return request.put('/v1_0/user/channels', {
        channels: channelArr
    })
}
